<template>
  <div>blogInfos</div>
</template>

<script>
  import {findAllBlogInfo, findRecentlyTopNumberBlogInfo} from "@/api/blog/blogInfo";

  export default {
    name: "index",
    data() {
      return {
        blogInfos: [],
        topNBlogInfos: []
      }
    },
    /* 一般页面初始化都放在这 */
    mounted() {
      this.init();
    },
    methods: {
      /* 初始化方法 */
      async init() {
        await this.findAllBlogInfo();
        await this.findRecentlyTopNumberBlogInfo();
      },
      /* 获取所有的博客 */
      async findAllBlogInfo() {
        const data = await findAllBlogInfo()
        this.blogInfos = data
        console.log(this.blogInfos)
      },

      async findRecentlyTopNumberBlogInfo() {
        const data = await findRecentlyTopNumberBlogInfo(3);
        this.topNBlogInfos = data
        console.log(this.topNBlogInfos)
      }
    }
  }
</script>

<style scoped>

</style>
